﻿#pragma once

#include "Material/Material.h"
#include "Mesh/StaticMesh.h"
#include "Misc/StdHead.h"
#include "Scene/SceneNodeComponent.h"
#include "SkyBoxComponent.m.h"

class CRenderMeshInstance;

RCLASS() 
class WHENGINE_API RSkyBoxComponent:public RSceneNodeComponent
{
    ROBJECT

public:

    void SetTexture(RTextureCubePtr InTexture);

    virtual void Paint(CRenderScene* InRenderData) override;

    virtual void FirstTimeInitializeObject();

    RFUNCTION()
    bool GetHidden()
    {
        return Hidden;
    }
    
    RFUNCTION()
    void SetHidden(bool InNewHidden)
    {
        Hidden=InNewHidden; 
    }

protected:

    //天空盒纹理,如果为空则使用默认天空盒材质
    RFIELD(NotInScript)
    RTextureCubePtr Texture;
    
    RFIELD(NotInScript)
    bool Hidden=false;

    bool bTextureDirty=true;

    //初值为默认天空盒材质
    RFIELD(NotInScript)
    TSharedObjectPtr<RMaterial> Material;

};